Skip to content

feat: split LogoutListener from AttributeListener#685

Merged
denischilik merged 22 commits intoworkstation/6.0-Releasefrom
feat/remove-attribute-listener
Mar 30, 2026
Merged

feat: split LogoutListener from AttributeListener#685
denischilik merged 22 commits intoworkstation/6.0-Releasefrom
feat/remove-attribute-listener

Conversation

@denischilik
Copy link
Copy Markdown

Summary

  • Introduces KitIntegration.LogoutListener as a separate contract from the deprecated AttributeListener.
  • KitManagerImpl.logout() invokes logout() only on kits that implement LogoutListener.
  • All embedded kits that previously implemented AttributeListener now explicitly implement LogoutListener as well.
  • AttributeListenerTestKit implements both interfaces for instrumented tests.

Introduce KitIntegration.LogoutListener for logout handling; AttributeListener
no longer extends it. KitManagerImpl calls logout() on LogoutListener only.
Embedded kits that implement AttributeListener now explicitly implement
LogoutListener; AttributeListenerTestKit updated accordingly.
@denischilik denischilik requested a review from a team as a code owner March 27, 2026 18:21
@cursor
Copy link
Copy Markdown

cursor bot commented Mar 27, 2026

PR Summary

Medium Risk
Moderate risk because it changes the interface contract used by kits for logout propagation and adjusts CI/build dependency resolution, which could break kit builds or logout forwarding if any kit isn’t updated correctly.

Overview
Kit logout handling is decoupled from the deprecated AttributeListener. A new KitIntegration.LogoutListener interface is introduced, logout() is removed from AttributeListener, and KitManagerImpl.logout() now invokes logout only for providers implementing LogoutListener.

Embedded kits and tests are updated to match the new contract. Kits that previously relied on AttributeListener for logout now explicitly implement LogoutListener, and AttributeListenerTestKit implements both.

CI and kit build plumbing is tightened for version/repo resolution. Workflows export ORG_GRADLE_PROJECT_VERSION/version, stop passing -PVERSION=... inline, and run kit lint/tests with -Pmparticle.kit.mparticleFromMavenLocalOnly=true; KitPlugin adds repository filtering to force com.mparticle dependencies to come from mavenLocal() when enabled and falls back to root VERSION to avoid + resolution. Trunk linter versions are also bumped (checkov, markdownlint, prettier).

Written by Cursor Bugbot for commit 161aae1. This will update automatically on new commits. Configure here.

Kotlin CI failed resolving import com.mparticle.kits.KitIntegration.LogoutListener
for Java nested interfaces; use KitIntegration.LogoutListener in implements lists.

Made-with: Cursor
thomson-t
thomson-t previously approved these changes Mar 27, 2026
Ensures settings-kits.gradle resolves android-kit-base from the same
version published to mavenLocal, not the latest from Maven Central.

Made-with: Cursor
Use import com.mparticle.kits.KitIntegration.LogoutListener and LogoutListener
in kit implementations and KitManagerImpl instead of qualified KitIntegration.LogoutListener.

Made-with: Cursor
KitPlugin resolves android-kit-base via VERSION; isolated UA runs from
a subproject previously omitted -PVERSION and fell back to '+' (Central).
Run from repo root with -p and -PVERSION aligned with VERSION file.

Made-with: Cursor
Export VERSION from VERSION file to GITHUB_ENV so Gradle resolves the same
project property without repeating -PVERSION on every command.

Made-with: Cursor
@denischilik denischilik force-pushed the feat/remove-attribute-listener branch from 5d009a2 to 4848718 Compare March 27, 2026 20:52
@denischilik denischilik force-pushed the feat/remove-attribute-listener branch 2 times, most recently from 4848718 to e7d3b44 Compare March 30, 2026 12:57
Add optional exclusiveContent in KitPlugin so com.mparticle artifacts
(android-kit-base, android-kit-plugin) resolve only from mavenLocal when
-Pmparticle.kit.mparticleFromMavenLocalOnly=true or MPARTICLE_KIT_FROM_MAVEN_LOCAL_ONLY.

Enable the flag in PR and daily workflows after publishMavenPublicationToMavenLocal
so kit lint and tests use freshly published local artifacts, not Maven Central.

Made-with: Cursor
Kit subprojects may not see ORG_GRADLE_PROJECT_VERSION / VERSION; falling
back to rootProject avoids '+' and matches publishMavenPublicationToMavenLocal.

Made-with: Cursor
Ensure kit lint and test jobs pass VERSION explicitly so settings-kits builds resolve the locally published android-kit-base/android-core artifacts instead of drifting to a mismatched version.

Made-with: Cursor
…ence

Use forRepository(repositories.mavenLocal()) in exclusiveContent so the kit plugin configures repositories correctly when mparticleFromMavenLocalOnly is enabled.

Made-with: Cursor
…tion

Replace exclusiveContent with repository content filters so com.mparticle resolves only from mavenLocal while avoiding DSL incompatibilities in Gradle 8.5 Groovy builds.

Made-with: Cursor
Replace removed KitIntegration userIdentities access with currentUser.userIdentities when building Adobe audience sync parameters.

Made-with: Cursor
Replace removed KitIntegration userIdentities access with currentUser.userIdentities when generating Leanplum user IDs.

Made-with: Cursor
Pass VERSION and mparticleFromMavenLocalOnly to isolated urbanairship lint/ktlint/test jobs so they resolve android-kit-base/android-core from local Maven artifacts consistently.

Made-with: Cursor
Remove preconfigured project repositories before applying local-only filters so com.mparticle artifacts cannot resolve from unfiltered root repositories when mparticleFromMavenLocalOnly is enabled.

Made-with: Cursor
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Replace KitIntegration.AttributeListener references in class inheritance clauses with imported AttributeListener for consistency with other listener types.

Made-with: Cursor
Use a safe-call when reading currentUser.userIdentities during ID sync to avoid NPE when no current user is available.

Made-with: Cursor
Keep mparticle exclusion only on Maven Central and use the default google repository configuration since com.mparticle artifacts are not published there.

Made-with: Cursor
Drop unused KitIntegration import in AttributeListenerTestKit to satisfy ktlint androidTest checks.

Made-with: Cursor
Export both Gradle VERSION/version properties via GITHUB_ENV and remove redundant -Pversion CLI overrides from kit-related workflow commands.

Made-with: Cursor
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@denischilik denischilik requested a review from thomson-t March 30, 2026 17:12
import org.json.JSONObject
import java.math.BigDecimal
import java.util.LinkedList
import com.mparticle.kits.KitIntegration.AttributeListener
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger lint errors since the imports are not sorted. Something we can fix when the lint is unified across all the kits.

@denischilik denischilik merged commit 61fcacf into workstation/6.0-Release Mar 30, 2026
21 of 23 checks passed
@denischilik denischilik deleted the feat/remove-attribute-listener branch March 30, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants